package com.dykj.fireFighting.web.enums;

public enum CommandEnum {
    insertDevHis("insertDevHis", "插入设备运行记录", "com.dykj.fireFighting.web.mq.consumer.business.InsertDevHis"),
    insertDevHisWater("insertDevHisWater", "插入水设备运行记录", "com.dykj.fireFighting.web.mq.consumer.business.InsertDevHisWater"),
    fireWebSocketPush("fireWebSocketPush", "火灾报警系统websocket推送", "com.dykj.fireFighting.web.mq.consumer.business.FireWebSocketPush"),
    waterWebSocketPush("waterWebSocketPush", "水系统websocket推送", "com.dykj.fireFighting.web.mq.consumer.business.WaterWebSocketPush"),
    fireAppPush("fireAppPush", "火灾报警系统app推送", "com.dykj.fireFighting.web.mq.consumer.business.FireAppPush"),
    waterAppPush("waterAppPush", "水系统app推送", "com.dykj.fireFighting.web.mq.consumer.business.WaterAppPush");

    private final String tag;
    private final String name;
    private final String text;

    public String getText() {
        return text;
    }

    public String getTag() {
        return tag;
    }

    public static String getName(String tag) {
        for (CommandEnum c : CommandEnum.values()) {
            if (c.getTag().equals(tag)) {
                return c.name;
            }
        }
        return null;
    }

    public static String getTextByTag(String tag) {
        for (CommandEnum c : CommandEnum.values()) {
            if (c.getTag().equals(tag)) {
                return c.text;
            }
        }
        return null;
    }

    public static CommandEnum getByName(String name) {
        for (CommandEnum c : CommandEnum.values()) {
            if (c.getName().equals(name)) {
                return c;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    CommandEnum(String tag, String name, String text) {
        this.tag = tag;
        this.name = name;
        this.text = text;
    }
}
